Socket
Socket
Sign inDemoInstall

babel-preset-env

Package Overview
Dependencies
Maintainers
6
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-env

A Babel preset for each environment.


Version published
Weekly downloads
722K
increased by3.47%
Maintainers
6
Weekly downloads
 
Created

What is babel-preset-env?

babel-preset-env is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, browser polyfills) are needed by your target environment(s). It automatically determines the Babel plugins and polyfills you need based on your supported environments.

What are babel-preset-env's main functionalities?

Automatic Polyfilling

Automatically includes polyfills for the features you use based on your target environments. The 'useBuiltIns' option set to 'usage' ensures that only the necessary polyfills are included.

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "corejs": 3
      }
    ]
  ]
}

Targeting Specific Environments

Allows you to specify the environments you want to support. The 'targets' option lets you define the browsers or Node.js versions you want to transpile your code for.

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "browsers": [
            "> 1%",
            "last 2 versions",
            "not ie <= 8"
          ]
        }
      }
    ]
  ]
}

Debugging

Enables debug mode to print useful information about the targets and plugins being used. This helps in understanding what transformations are being applied.

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "debug": true
      }
    ]
  ]
}

Other packages similar to babel-preset-env

FAQs

Package last updated on 10 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc